package top.goldenyear.porpoise.system.auth.controller.admin;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import top.goldenyear.porpoise.common.core.model.Ret;
import top.goldenyear.porpoise.system.auth.service.RouteService;

/**
 * @author airhead
 */
@Component(tag = "adminApi")
@Mapping("/route")
@Slf4j
public class RouteAdminController {
  @Inject private RouteService service;

  @Get
  @Mapping("getUserRoutes")
  public Ret getUserRoutes() {
    return Ret.okWithData(service.getUserRoutes());
  }

  @Get
  @Mapping("isRouteExist")
  public Ret isRouteExist(String routeName) {
    return Ret.okWithData(service.isRouteExist(routeName));
  }
}
